package com.catmiao.spark.sql.test

import org.apache.spark.SparkConf
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.{DataFrame, Dataset, SparkSession}

/**
 * @title: Spark01_sql_test01
 * @projectName spark_study
 * @description: TODO
 * @author ChengMiao
 * @date 2024/3/20 10:44
 */
object Spark01_sql_test02 {

  def main(args: Array[String]): Unit = {


    System.setProperty("HADOOP_USER_NAME", "root")

    val spark = SparkSession.builder()
      .enableHiveSupport()
      .master("local[*]")
      .appName("sql")
      .config("spark.sql.warehouse.dir", "hdfs://vm100:8020/user/hive/warehouse")
      .getOrCreate()


    spark.sql("select * from student").show()
  }

}
